# -*- coding: utf-8 -*-
"""
main
2025/9/8
@author: zhangzida
"""
import time

from Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    iframe_loc=(By.XPATH,'//iframe[starts-with(@id,x-URS-iframe1757)]')
    username_loc=(By.XPATH,'/html/body/div[2]/div[2]/div[2]/form/div/div[1]/div[2]/input')
    password_loc=(By.XPATH,'/html/body/div[2]/div[2]/div[2]/form/div/div[3]/div[2]/input[2]')
    login_loc=(By.XPATH,'/html/body/div[2]/div[2]/div[2]/form/div/div[8]/a')
    write_loc=(By.XPATH,'/html/body/div[1]/nav/div[1]/ul/li[2]')
    def iframe(self):
        self.frame(self.iframe_loc)
    def username(self):
        self.send_keys(self.username_loc,'zzd19525482253')
    def password(self):
        self.send_keys(self.password_loc,'zzd040708.')
    def login(self):
        self.click(self.login_loc)
    def write(self):
        self.click(self.write_loc)

    def luoji_login(self):
        self.open_url('https://www.126.com/')
        time.sleep(3)
        self.iframe()
        time.sleep(3)
        self.username()
        self.password()
        self.login()
        self.tui_frame()
        self.write()
        time.sleep(5)